﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Sisocana.Core.Models.DonacionEconomicaModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Donate  funds
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<h2>Support our work! Donate funds</h2>

<script src="<%: Url.Content("~/Scripts/jquery.validate.min.js") %>" type="text/javascript"></script>
<script src="<%: Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js") %>" type="text/javascript"></script>
<% Html.EnableClientValidation(); %>

<% using (Html.BeginForm()) { %>
    <%: Html.ValidationSummary(true) %>
    <% Html.HiddenFor(model => model.idONGDefinida); %>
    <fieldset>
        <legend>Donation amount (in USD)</legend>

        <div class="editor-label">
            <%: Html.LabelFor(model => model.monto) %>
        </div>
        <div class="editor-field">
            <%: Html.EditorFor(model => model.monto) %>
            <%: Html.ValidationMessageFor(model => model.monto) %>
        </div>
    </fieldset>
    <fieldset>
        <legend>Credit card information</legend>

        <div class="editor-label">
            <%: Html.LabelFor(model => model.nombreTitular) %>
        </div>
        <div class="editor-field">
            <%: Html.EditorFor(model => model.nombreTitular) %>
            <%: Html.ValidationMessageFor(model => model.nombreTitular) %>
        </div>

        <div class="editor-label">
            <%: Html.LabelFor(model => model.nroTarjeta) %>
        </div>
        <div class="editor-field">
            <%: Html.EditorFor(model => model.nroTarjeta) %>
            <%: Html.ValidationMessageFor(model => model.nroTarjeta) %>
        </div>

        <div class="editor-label">
            <%: Html.LabelFor(model => model.tipoTarjeta) %>
        </div>
        <div class="editor-field">
            <%: Html.DropDownList("tipoTarjeta") %> 
        </div>             
        <img height="36" width="172" title="Accepted Credit Cards" src="<%= Url.Content("~/Content/images/Credit_Card_Logo.jpg") %>" alt="Accepted Credit Cards" />
        <div class="editor-label">
            <%: Html.LabelFor(model => model.fechaVencimiento) %>
        </div>
        <div class="editor-field">
            <%= Html.DropDownList("ExpMonth", ViewData["ExpMonthSelectList"] as SelectList)%>
            <%= Html.DropDownList("ExpYear", ViewData["ExpYearSelectList"] as SelectList)%>
        </div>
        <div class="editor-label">
            <%: Html.LabelFor(model => model.cVVnumber) %>
        </div>
        <div class="editor-field">
            <%: Html.EditorFor(model => model.cVVnumber) %>
            <%: Html.ValidationMessageFor(model => model.cVVnumber) %>
        </div>
    </fieldset>

        <p>
            <input type="submit" value="Donate" />
        </p>
<% } %>
<form name="_xclick" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_donations" />
<input type="hidden" name="business" value="<%= Model.paypalLogin %>">
<input type="hidden" name="item_name" value="<%= Model.nombreONGDefinida %>">
<input type="hidden" name="return" value="<%= Url.Action("PDT", "Donations", null, "http") %>">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="rm" value="2">
<input type="hidden" name="custom" value="<%= Model.idONGDefinida %>">
<input type="image" height="80" width="80" src="<%= Url.Content("~/Content/images/donate-with-paypal.gif") %>" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
</form> 
<div>
    <a href="<%= Html.UrlTo("Donate") %>">Back to Donations</a>
</div>

</asp:Content>

<script runat="server">
    protected void Page_PreInit(Object sender, EventArgs e)
    {
        Master.MasterPageFile = Url.Content(ViewBag.Site.dir_master);
        MasterPage UserMaster = Master.Master;
        UserMaster.FindControl("NewsTitleContent").Visible = false;
        UserMaster.FindControl("VideoTitleContent").Visible = false;
        UserMaster.FindControl("ImageTitleContent").Visible = false;
    }
</script>